# 可以单继承也可以多继承
# 多继承的时候，如果多个父类有相同的属性或方法，优先调用继承顺序前面的父类的属性或方法
class Animal:
    category = 'animal'

    def eat(self):
        print('吃吃吃')

    def drink(self):
        print('喝喝喝')

    def sleep(self):
        print('睡觉')


class Animal2:
    category = 'animal2'

    def eat(self):
        print('吃吃吃2')


class Duck(Animal2, Animal):
    # category = 'duck'

    def swim(self):
        print('游泳')

    # def eat(self):
    #     print('鸭子吃吃吃')


duck = Duck()
duck.eat()
print(duck.category)
